package com.gxa.ssm340.controller;

import com.gxa.ssm340.common.R;
import com.gxa.ssm340.entity.pojo.Points;
import com.gxa.ssm340.service.PointsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *
 * @author Ben
 * @date 2023-10-24 14:23
 */
@Api(value = "PointsController",tags = "积分管理接口")
@RequestMapping("/user")
@RestController
public class PointsController {

    @Autowired
    private PointsService pointsService;

    @ApiOperation("查询获取积分操作方法")
    @GetMapping("/pointsGetList")
    public R getPoints(String phone) {
        List<Points> points = pointsService.getPoints(phone);
        return R.success(points);
    }

    @ApiOperation("查询兑换积分操作方法")
    @GetMapping("/pointsExchangeList")
    public R exchangePoints(String phone) {
        List<Points> points = pointsService.exchangePoints(phone);
        return R.success(points);
    }

}
